//
//  LGMedicineBallSectionView.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/8/29.
//  区头View

#import "LGMedicineBallSectionView.h"
@implementation LGMedicineBallSectionView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}


#pragma mark
#pragma mark ====> 创建控件
-(void)createSubView{
    self.cornerRidus = 15;
    self.backgroundColor = [UIColor whiteColor];
    [self setShadoWithColor:@"#B3C5D9" offset:CGSizeMake(0, 2) opacity:0.15 radius:15];
    [self addSubview:self.iconView];
    [self addSubview:self.titleLabel];
    [self addSubview:self.lineView];

    [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(self).offset(viewPix(15));
        make.width.height.equalTo(@(viewPix(24)));
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconView.mas_right).offset(viewPix(6));
        make.centerY.equalTo(self.iconView);
    }];

    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(viewPix(12));
        make.right.equalTo(self).offset(-viewPix(12));
        make.top.equalTo(self).offset(viewPix(46));
        make.height.equalTo(@(0.5));
    }];
}

-(UIImageView *)iconView{
    if(!_iconView){
        _iconView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
    }
    return _iconView;
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(15, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _titleLabel;
}

-(UIView *)lineView{
    if(!_lineView){
        _lineView = [[UIView alloc] init];
        _lineView.backgroundColor = [UIColor colorWithString:@"#E8E8E8"];
    }
    return _lineView;
}

@end
